package com.itheima.exception;

import com.itheima.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExceptionControllerAdvice {
    @ExceptionHandler(RuntimeException.class)
    public Result ex1(RuntimeException ex){
        log.error("出现Runtime异常");
        ex.printStackTrace();
        return  new Result(false,"系统繁忙,请稍后尝试");
    }
}
